#ifndef _BUS_H_
#define _BUS_H_

#include "device/Device.h"

class Bus: public Device {
public:
    Bus()  = default;
    ~Bus() = default;
    bool read(word_t start_addr, size_t length, uint8_t* buffer, bool& mmio) override;
    bool write(word_t start_addr, size_t length, const uint8_t* buffer, bool& mmio) override;
    void update() override;
    void add_device(word_t start_addr, size_t length, Device* device);
private:
    std::map<std::pair<word_t, word_t>, Device*> devices;
};

#endif
